﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Collections.ObjectModel;

namespace BusinessModel
{
    /// <summary>
    /// * Unnormal Properties : UnitChanges, ApplyDate
    /// </summary>
    public class Product : BaseModel
    {
        #region Primitive Properties
        public global::System.Int32 TypeId
        {
            get
            {
                return _TypeId;
            }
            set
            {
                if (_TypeId != value)
                {
                    _TypeId = value;
                    OnPropertyChanged("TypeId");
                }
            }
        }
        private global::System.Int32 _TypeId;

        public global::System.Int32 UnitId
        {
            get
            {
                return _UnitId;
            }
            set
            {
                if (_UnitId != value)
                {
                    _UnitId = value;
                    OnPropertyChanged("UnitId");
                }
            }
        }
        private global::System.Int32 _UnitId;

        public global::System.String Code
        {
            get
            {
                return _Code;
            }
            set
            {
                if (_Code != value)
                {
                    _Code = value;
                    OnPropertyChanged("Code");
                }
            }
        }
        private global::System.String _Code;

        public global::System.String Name
        {
            get
            {
                return _Name;
            }
            set
            {
                if (_Name != value)
                {
                    _Name = value;
                    OnPropertyChanged("Name");
                }
            }
        }
        private global::System.String _Name;

        public Nullable<global::System.Int32> Quantity
        {
            get
            {
                return _Quantity;
            }
            set
            {
                if (_Quantity != value)
                {
                    _Quantity = value;
                    OnPropertyChanged("Quantity");
                }
            }
        }
        private Nullable<global::System.Int32> _Quantity;

        public Nullable<global::System.Int32> SalePriceUnit
        {
            get
            {
                return _SalePriceUnit;
            }
            set
            {
                if (_SalePriceUnit != value)
                {
                    _SalePriceUnit = value;
                    OnPropertyChanged("SalePriceUnit");
                }
            }
        }
        private Nullable<global::System.Int32> _SalePriceUnit;

        public global::System.String Note
        {
            get
            {
                return _Note;
            }
            set
            {
                if (_Note != value)
                {
                    _Note = value;
                    OnPropertyChanged("Note");
                }
            }
        }
        private global::System.String _Note;
        #endregion

        //UnitChanges
        private IList<UnitChange> _UnitChanges;
        public IList<UnitChange> UnitChanges
        {
            get
            {
                if (_UnitChanges == null)
                    _UnitChanges = new ObservableCollection<UnitChange>();
                return _UnitChanges;
            }
            set
            {
                if (_UnitChanges != value)
                {
                    _UnitChanges = value;
                    OnPropertyChanged("UnitChanges");
                }
            }
        }

        #region Extend Properties
        //TypeName
        private string _TypeName;
        public string TypeName
        {
            get { return _TypeName; }
            set
            {
                if (_TypeName != value)
                {
                    _TypeName = value;
                    OnPropertyChanged("TypeName");
                }
            }
        }
        //TypeCode
        private string _TypeCode;
        public string TypeCode
        {
            get { return _TypeCode; }
            set
            {
                if (_TypeCode != value)
                {
                    _TypeCode = value;
                    OnPropertyChanged("TypeCode");
                }
            }
        }
        //UnitName
        private string _UnitName;
        public string UnitName
        {
            get { return _UnitName; }
            set
            {
                if (_UnitName != value)
                {
                    _UnitName = value;
                    OnPropertyChanged("UnitName");
                }
            }
        }
        //ApplyDate
        public Nullable<global::System.DateTime> ApplyDate
        {
            get
            {
                return _ApplyDate;
            }
            set
            {
                if (_ApplyDate != value)
                {
                    _ApplyDate = value;
                    OnPropertyChanged("ApplyDate");
                }
            }
        }
        private Nullable<global::System.DateTime> _ApplyDate;
        #endregion Extend Properties
    }
}
